<?php
$arr = [
    'hello',
    'world'
];
echo current($arr); // hello
echo next($arr); // world，指针向后移动
echo prev($arr); //
echo key($arr); // 当前数组的下标
echo '--------------------华丽的分割线---------------------';

$users = [
    ['name' => '小明', 'age' => 20],
    ['name' => '小李', 'age' => 11],
    ['name' => '小华', 'age' => 21],
];
?>
<table class="" border="1">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>年龄</th>
    </tr>
    <?php
    while ($user = current($users)):?>
        <tr>
            <td><?php echo key($users) + 1 ?></td>
            <td><?php echo $user['name'] ?></td>
            <td><?php echo $user['age'] ?></td>
        </tr>
    <?php next($users); endwhile; ?>
</table>


